import { defineStore } from 'pinia';
import type { UserState } from './types';
import { LOCALSTORAGE_ENUM } from '@/enum/system';

const useUserStore = defineStore(LOCALSTORAGE_ENUM.USER, {
  state: (): UserState => ({
    name: '',
    token: '',
    userInfo: undefined,
    lang: 'en',
    paths: {},
    oss: true,
  }),
  persist: true,
});

export default useUserStore;
